
var wQueryforsb = {};
wQueryforsb.trim = function(text) {
	while(text[0] == " ") {
		text = text.substring(1);
	}
	while(text[text.length-1]==" ") {
		text = text.substring(0, text.length-1);
	}
	return text;
}


wQueryforsb.createXMLHttpRequest = function() {
	return new XMLHttpRequest();
}

wQueryforsb.get = function(url, data, fun, type) {
	var xmlhttp = this.createXMLHttpRequest();
	xmlhttp.onreadystatechange = function() {
		if( xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			var data;
			if(type == "json"){
				data = JSON.parse(xmlhttp.responseText);
			}
			fun(data);
		}
	}
	xmlhttp.open("GET", url, true);
	xmlhttp.send();
}
